<%@ page contentType="text/html; charset=iso-8859-1"%>
<%@ page language="java"%>
<%@ page import="java.util.*,java.sql.*,java.math.BigDecimal,java.text.SimpleDateFormat" %>
<%@ page import="pc.system.*,wstrader.*" %>
<%
    Users usr = Trader.getUser(request.getParameter("uid"));
	usr.setDebug(true);
	Vector    vt = null;
	//Row       rw = null;
	ResultSet rs = null;
	String    ls = "All";
	String    search_key = request.getParameter("search_key");
	if (search_key != null) search_key = search_key.trim();
	else search_key = "";
	if (task != null) {
		//task.getFilter().set("caller",task.getLinkPage());
		//System.out.println(task.getLinkPage());
	}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Pacorini Vietnam</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
.scroll
{
    FONT: 9pt arial;
    COLOR: #A2C5EC;
    background-color: #FFFFFF;
    border: medium none
}
</style>

<script language="JavaScript">
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function getPresentDate()
{
	var mydate=new Date()
	var year=mydate.getYear()
	if (year < 1000)
	year+=1900
	year = year%100;
	if (year<10)
		year="0"+year
	var month=mydate.getMonth()
	var daym=mydate.getDate()
	if (daym<10)
	daym="0"+daym

	var ddate=""+daym+"-"+montharray[month]+"-"+year;
	return ddate;
}

function getPresentTime()
{		
	var mydate=new Date()
	var hours=mydate.getHours()
	var minutes=mydate.getMinutes()
	var seconds=mydate.getSeconds()
	
	if (hours<=9){
	hours="0"+hours}

	if (minutes<=9){
	minutes="0"+minutes}

	if (seconds<=9){
	seconds="0"+seconds}

	var ddate=""+hours+":"+minutes;
	return ddate;
}

function getthedate()
{
	var mydate = new Date();
	var year=mydate.getYear();
	if (year < 1000) year+=1900;
	var day=mydate.getDay();
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym < 10) daym="0"+daym;
	var hours = mydate.getHours();
	var minutes = mydate.getMinutes();
	var seconds=  mydate.getSeconds();
	var dn = "AM";
	if (hours >= 12) dn="PM";
	if (hours > 12)  hours=hours-12;

	if (hours == 0) hours = 12;

	if (minutes<=9) minutes = "0" + minutes;

	if (seconds <= 9) seconds = "0" + seconds;

	//change font size here
	var ddate=" "+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn +" ";
	document.bannerform.clock1.value=ddate;
}

function load_date()
{
	if (document.all||document.getElementById) {
		setInterval("getthedate()",1000);
	}
}

function doLink(linkPage)
{
	if (linkPage == "") return;
	document.formLink.uid.value = "<%=usr.getuid()%>";
	document.formLink.action     = linkPage;
	document.formLink.submit();
}

function doSort(field_sort)
{
	//alert(field_sort);
	var form = document.formMain;
	form.field_sort.value = field_sort;
	form.submit();
}

function doFilter(linkPage)
{
	var form = document.formMain;
	if (linkPage != null) form.action = linkPage;
	form.submit();
}

function doTask(upd)
{
	var form = document.formMain;
	if (upd != null) form.update.value = upd;
	form.submit();
}

function doListView()
{
	doFilter('<%=usr.getFilter().getStringValue("caller")%>')
}

function doSearch(mouse)
{   
	if (mouse != null && mouse == true) {
		return doTask(100);
	}
	
	if (!window.event || window.event.keyCode != 13) return;

	doTask(100);
}

function doCheck(obj,checked,unchecked)
{
	var obj_ = getObj(obj+"_");
	var obj  = getObj(obj);
	if (checked == null) checked = 1;
	if (unchecked == null) unchecked = 0;
	obj.value = (obj_.checked ? checked : unchecked);
}
</script>

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="load_date();">

<SCRIPT LANGUAGE="JavaScript" SRC="js/popcalendar.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="include/Utils.js"></SCRIPT>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td background="images/pattern.jpg">&nbsp;</td>
    <td width="780" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="125" valign="top"><table width="125" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td height="130" valign="top" background="images/coffee.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td width="35">&nbsp;</td>
                      <td height="19">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                      <td><img src="images/water1.gif" width="63" height="62"></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
          <td valign="top" background="images/pattern.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td><img src="images/img001.jpg"  height="56" border="0"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td align="left" valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
<%	
	for (int i = 0; i < usr.getChildSize() ; i++) {
	    Tasks ts = (Tasks)(usr.getTask(i));
%>
	<td width="78"><img src="<%=ts.getButton().getImage()%>" width="78" height="28" border="0" onClick="doLink('<%=ts.doLink()%>')"></td>
<%}%>
                      <td>&nbsp;</td>
                    </tr>
                  </table> 
                </td>
              </tr>
              <tr> 
                <td height="21" align="left" valign="top"> 
<%	
	if (usr.getTaskLevel(0) != null) {		
		Tasks act = (Tasks)usr.getTaskLevel(0); 
		for (int i = 0; i < act.getChildSize() ; i++) {
			Tasks ts = act.getTask(i);
%>
		<img src="<%=ts.getButton().getImage()%>" border="0" onClick="doLink('<%=ts.doLink()%>')">
<%		}
	}
%>
				</td> 
              </tr>
              <tr> 
                <form name="bannerform">
                  <td align="right"><input align="right" type="text" name="clock1" size="36" class=scroll onfocus="blur()"></td>
                </form>
              </tr>
            </table></td>
        </tr>
      </table></td>
    <td background="images/pattern.jpg">&nbsp;</td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<tr> 
    <td>&nbsp;</td>
    <td width="<%=Trader.window_width%>" valign="top">
		<%Trader.window_width = "800";%>
	   <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="100%"><table width="100%" height="12" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="12" height="12" valign="top" background="images/topbg.gif"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="12"><img src="images/topleftframe.gif" width="12" height="12"></td>
                    </tr>
                    <tr>
                      <td background="images/img101.gif">&nbsp;</td>
                    </tr>
                  </table></td>
                <td height="43" valign="top" background="images/img100.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      
                  <td width="100" height="43" background="images/img103.gif">&nbsp;</td>
                      <td background="images/img105.gif">&nbsp;</td>
                      <td width="104"><img src="images/img104.gif" width="104" height="43"></td>
                      <td width="200" valign="middle">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            
                        <td height="24" align="right" valign="middle"> 
<%	
	if (usr.getTaskLevel(1) != null) {
		Tasks act = usr.getTaskLevel(1); 
		for (int i = 0; i < act.getChildSize() ; i++) {
			Tasks ts = act.getTask(i);
%>
			<img src="<%=ts.getButton().getImage()%>" border="0" onClick="doLink('<%=ts.doLink()%>')">
<%		}
	}
%>
                        </td>
                          </tr>
                        </table>                        
						</td>
                    </tr>
                  </table></td>
                <td width="12" background="images/topbg.gif"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td height="12"><img src="images/toprightframe.gif" width="12" height="12"></td>
                    </tr>
                    <tr> 
                      <td height="31" background="images/img102.gif">&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
        <tr> 
<td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="12" background="images/leftframe.gif">&nbsp;</td>
                <td valign="top" bgcolor="#FBFBF5" background="images/bg1.jpg" style="background-repeat:no-repeat; background-position: bottom right"> 

<form name="formLink" action="" method="post">
	<input type="hidden" name="uid"       id="uid"     value="<%=usr.getuid()%>">
</form>

<!-- This area for the contents of body-->
12345
</td>
                <td width="12" background="images/rightframe.gif">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td><table width="100%" height="12" border="0" cellpadding="0" cellspacing="0">
              <tr> 
                <td width="12" valign="top"><img src="images/bottomleftframe.gif" width="12" height="14"></td>
                <td background="images/bottomframe.gif"><img src="images/bottomframe.gif" width="128" height="19"></td>
                <td width="12" valign="top"><img src="images/bottomrightframe.gif" width="12" height="14"></td>
              </tr>
            </table></td>
        </tr>
      </table></td>
    <td>&nbsp;</td>
  </tr>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td height="60" align="center" valign="middle"><img src="images/logopacorini.gif" width="101" height="31"></td>
  </tr>
</table>
<script language="javascript">
	if (<%=user.getRight("client")%> != 0) {
		hide("new_btn");
		hide("save_btn");
		hide("del_btn");
		hide("allocation_btn");
		hide("tab_report_1");
		hide("tab_report_2");
	}
</script>
</body>
</html>

<%
	usr.getSysLog().showMessage();
%>
